import { NoSkinCellRenderer } from "../../common/item/NoSkinCellRenderer";
import { SCrossSWSettlementInfo } from "../../../../../Message/Public/SCrossSWSettlementInfo";
import { AvatarInfo } from "../../../resource/info/AvatarInfo";
import { AvatarType } from "../../../resource/info/AvatarType";
import { Language } from "../../../../../extend/language/Language";
import { CareerConfig } from "../../../resource/CareerConfig";
import { Cache } from "../../../cache/Cache";
import { FilterConst } from "../../../../component/gconst/FilterConst";
import { GlobalClass } from "../../../../../com/mui/core/GlobalClass";
import { ImagesConst } from "../../../resource/ImagesConst";
import { ObjCreate } from "../../common/ObjCreate";
import { GImageBitmap } from "../../../../../com/mui/controls/GImageBitmap";
import { ScaleBitmap } from "../../../../../com/mui/display/ScaleBitmap";
import { GTextFiled } from "../../../../../com/mui/controls/GTextFiled";
//class AttachedSoulBattlefielResultRenderer
    
    export  class AttachedSoulBattlefielResultRenderer extends NoSkinCellRenderer
    {
        constructor()
        {
            super();
            return;
        }

        public /* override */ set data(arg1: Object)
        {
            if (typeof arg1 === "scrossswsettlementinfo") 
            {
                super.data = arg1;
                this._vo = arg1 as SCrossSWSettlementInfo;
                this._bmpHead.imgUrl = AvatarInfo.getPlayerAvatarName(this._vo.miniPlayer.camp, this._vo.miniPlayer.sex, AvatarType.BIG, this._vo.miniPlayer.avatarId);
                this._tfName.text = Language.getString(44580) + this._vo.miniPlayer.name;
                this._tfCareer.text = Language.getString(44582) + CareerConfig.instance.getInfoByCode(this._vo.miniPlayer.career).name;
                this._tfKillNum.text = Language.getString(44585) + this._vo.killNum;
                this._tfFightingNum.text = Language.getString(44581) + this._vo.miniPlayer.warfare;
                this._tfTotalHurt.text = Language.getString(28634) + this._vo.damageAmount;
                this._tfTeamMark.text = Language.getString(28635) + int(this._vo.damageAmount / 10);
                this._bmpSelfBg.visible = this._vo.miniPlayer.entityId.id == Cache.instance.role.entityInfo.entityId.id;
                if (this._vo.status != 0) 
                {
                    this._bmpHead.filters = [];
                    this._bmpResult.bitmapData = null;
                }
                else 
                {
                    this._bmpHead.filters = [FilterConst.colorFilter2];
                    this._bmpResult.bitmapData = GlobalClass.getBitmapData(ImagesConst.TeammateFlee);
                }
            }
            return;
        }

        protected /* override */ createChildren(): void
        {
            super.createChildren();
            this._bmpSelfBg = ObjCreate.createBg(0, 0, 320, 75, this, "SelectedBg");
            this._bmpSelfBg.visible = false;
            this.addChild(new GImageBitmap("GangFightsPlayerHeadBg.png", 0, 0));
            this._bmpHead = new GImageBitmap();
            ObjCreate.setObjAttri(this._bmpHead, 7, 7, -1, -1, this);
            this._tfName = ObjCreate.createGTextField("", 80, 9, 180, 20, this);
            this._tfCareer = ObjCreate.createGTextField("", 80, 30, 120, 20, this);
            this._tfKillNum = ObjCreate.createGTextField("", 80, 51, 120, 20, this);
            this._tfFightingNum = ObjCreate.createGTextField("", 200, 9, 120, 20, this);
            this._tfTotalHurt = ObjCreate.createGTextField("", 200, 30, 120, 20, this);
            this._tfTeamMark = ObjCreate.createGTextField("", 200, 51, 120, 20, this);
            this._bmpResult = ObjCreate.createGBitmap("", 42, 56, this);
            return;
        }

        /* internal */ /* var */_bmpSelfBg: ScaleBitmap;

        /* internal */ /* var */_bmpHead: GImageBitmap;

        /* internal */ /* var */_tfName: GTextFiled;

        /* internal */ /* var */_tfCareer: GTextFiled;

        /* internal */ /* var */_tfKillNum: GTextFiled;

        /* internal */ /* var */_tfFightingNum: GTextFiled;

        /* internal */ /* var */_tfTotalHurt: GTextFiled;

        /* internal */ /* var */_tfTeamMark: GTextFiled;

        /* internal */ /* var */_bmpResult: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_vo: SCrossSWSettlementInfo;
    }
